from pymongo import MongoClient
import pprint as pp
from bson.objectid import ObjectId

client = MongoClient('172.29.174.125', 27017)

db = client.test

table = db.unicorns

row = table.find_one({
    '_id': ObjectId('624bab9be1a12a7fdc188831')
})
pp.pprint(row)

for i, row in enumerate(table.find({'name': {'$exists': True}}).sort('weight')):
    print(i)
    pp.pprint(row)

count = table.count_documents({})
print('Count:', count)
count = table.count_documents({
    'parent_epoch': 0
})
print('Count:', count)
